Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Social Links: Don't prepend URL fragments #68655

Merged
merged 1 commit into from
Jan 15, 2025

Conversation

Mamaduka
Copy link
Member

@Mamaduka Mamaduka commented Jan 14, 2025

What?

This is a follow-up to #42167.
PR of #55543 (comment).

PR updates logic in Social Links rendered and avoids prepending URL fragments with https://.

Why?

The fragments are valid URLs often used as placeholders for Social Icons. They can also refer to social sections on a website.

Testing Instructions

  1. Open a Post or Page
  2. Insert the example block (snippet below).
  3. Save and view the post.
  4. On the front end, inspect block elements and confirm that the Instagram fragment has no https:// prefix.
  5. Confirm that other links are rendered correctly.
Social Links example

<!-- wp:social-links -->
<ul class="wp-block-social-links"><!-- wp:social-link {"url":"//twitter.com/WordPress","service":"twitter"} /-->
<!-- wp:social-link {"url":"profiles.wordpress.org/wordpress/","service":"wordpress"} /-->
<!-- wp:social-link {"url":"http://github.com/WordPress","service":"github"} /-->
<!-- wp:social-link {"url":"#instagram","service":"instagram"} /--></ul>
<!-- /wp:social-links -->

Testing Instructions for Keyboard

Same.

Screenshots or screencast

@Mamaduka Mamaduka added [Type] Bug An existing feature does not function as intended [Block] Social Affects the Social Block - used to display Social Media accounts labels Jan 14, 2025
@Mamaduka Mamaduka self-assigned this Jan 14, 2025
Copy link

github-actions bot commented Jan 14, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: Mamaduka <[email protected]>
Co-authored-by: t-hamano <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link

Flaky tests detected in 7d7c7f4.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12764706932
📝 Reported issues:

@Mamaduka Mamaduka added the Good First Review A PR that's suitable for someone looking to contribute for the first time by reviewing code label Jan 14, 2025
@Mamaduka Mamaduka requested a review from t-hamano January 15, 2025 04:38
Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sence 👍

@Mamaduka
Copy link
Member Author

Thanks, @t-hamano!

@Mamaduka Mamaduka merged commit 8ba15b1 into trunk Jan 15, 2025
75 checks passed
@Mamaduka Mamaduka deleted the fix/social-icons-allow-url-fragments branch January 15, 2025 05:19
@github-actions github-actions bot added this to the Gutenberg 20.1 milestone Jan 15, 2025
Gulamdastgir-Momin pushed a commit to Gulamdastgir-Momin/gutenberg that referenced this pull request Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Social Affects the Social Block - used to display Social Media accounts Good First Review A PR that's suitable for someone looking to contribute for the first time by reviewing code [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants